package com.util;

import android.widget.ImageView;

import com.android.ocean.util.common.StringUtil;
import com.matang.R;
import com.modle.User;

public class OUtil {
	/**
	 * 设置用户头像的背景
	 * 
	 * @param user
	 * @param bgIv
	 */
	public static void setThumbBg(User user, ImageView bgIv) {
		if (null != user) {
			if (user.type.equalsIgnoreCase(User.U_TYPE_ORG)) {
				if (user.isMember) {
					bgIv.setImageResource(R.drawable.artist_is_orgmember_bg);
				} else {
					bgIv.setImageResource(R.drawable.artist_is_org_bg);
				}
			} else if (user.type.equalsIgnoreCase(User.U_TYPE_YR)
					&& user.isMember) {
				bgIv.setImageResource(R.drawable.artist_is_member_bg);
			} else {
				bgIv.setImageBitmap(null);
			}
		} else {
			bgIv.setImageBitmap(null);

		}

	}
	/**
	 * ]
	 * @Description:TODO招聘职位的info
	 * @param@param uType
	 * @param@param isMember
	 * @param@param bgIv
	 * @return void
	 * @author zhuw
	 * @date 2013-12-1 下午1:09:39
	 */
	public static void setThumbBg(String uType,boolean isMember, ImageView bgIv) {
		if (null != uType) {
			if (uType.equalsIgnoreCase(User.U_TYPE_ORG)) {
				if (isMember) {
					bgIv.setImageResource(R.drawable.artist_is_orgmember_bg);
				} else {
					bgIv.setImageResource(R.drawable.artist_is_org_bg);
				}
			} else if (uType.equalsIgnoreCase(User.U_TYPE_YR)
					&& isMember) {
				bgIv.setImageResource(R.drawable.artist_is_member_bg);
			} else {
				bgIv.setImageBitmap(null);
			}
		} else {
			bgIv.setImageBitmap(null);
			
		}
		
	}

	public static void setSexImg(User user, ImageView imgIv) {
		if (null != user && !StringUtil.isNull(user.male)) {
			if (user.male.equalsIgnoreCase(User.MALE_F)) {
				imgIv.setImageResource(R.drawable.female_i);
			} else {
				imgIv.setImageResource(R.drawable.male_i);

			}
		} else {
			imgIv.setImageBitmap(null);

		}

	}

}
